package cpr;

import java.io.BufferedInputStream;
import java.io.InputStream;




interface ConsoleCommand {
	public boolean supportParamTypes(Class[] params);
	public void run(Object[] params);
}

class PCommand implements ConsoleCommand{
	public boolean supportParamTypes(Class[] params) {
		boolean res = false;
		int[] sss = new int[0];
		if (params.length!=2) return res;
		if (
				(params[0]==Integer.class)&&
				(params[1]==sss.getClass())
				) {
			res = true;
		}
		return res;
	}
	public void run(Object[] params) {
		Integer i = (Integer)params[0];
		int[] aaa = (int[])params[1];
		Printer.print("Interer="+i.intValue()+" array len ="+aaa.length);
	}
	
}

public class Console {
	public Console() {
		prefix = "> ";
		
	}
	private static  Console single = new Console();
	public static Console getInstance() {
		return single;
	}
	
	public String getInputString() {
		InputStream is = System.in;
		
		StringBuffer sb = new StringBuffer();
		char lastChar = 0;
		while (lastChar!='\r') {
			try {
				while (is.available()==0) {
					Thread.currentThread().sleep(100);
				}
				byte[] b = new byte[1];
				is.read(b,0,1);
				lastChar = (char)b[0];
				if (lastChar!='\r') {
					sb.append(lastChar);
				}
			} catch (Exception ex) {
				
			}
		}
		
		return sb.toString();
	}
	private String prefix;
	public String getCommand() {
		Printer.print(prefix);
		String s = getInputString();
		return s;
	}
	
	
	public Object getParam(String str) {
		if (str.charAt(0)=='"') {
			return str.substring(1, str.length()-1);
		} else if (str.charAt(0)=='{'){
			String s = str.substring(1, str.length()-1);
			String[] ss = s.split(",");
			int[] res = new int[ss.length];
			for (int i = 0; i < res.length; i++) {
				res[i] = Integer.parseInt(ss[i]);
			}
			return res;
		} else {
			return new Integer(str);
		}
	}
	public static void main(String[] args) {
		Console cn = Console.getInstance();
		String s =cn.getInputString();
		String[] ss = s.split(";");
		Object[] params = new Object[ss.length];
		for (int i = 0; i < ss.length; i++) {
			String s1 = ss[i].trim();
			ss[i] = s1;
			params[i] = cn.getParam(ss[i]);
		}
		PCommand p = new PCommand();
		Class[] paramClasses = new Class[params.length];
		for (int i = 0; i < paramClasses.length; i++) {
			paramClasses[i]=params[i].getClass();
		}
		boolean b = p.supportParamTypes(paramClasses);
		if (b) {
			p.run(params);
		}
		int t=1;
	}
	
	
	
	
}
